1. Field of the Invention
This invention relates to a method and apparatus for various image measurements (including counting and discrimination) of the shapes and numbers of objects expressed in binary images in the field of image measurement, such as inspection or identification of parts on production lines, material or medical fields, and more particularly to a general or universal purpose image measurement and recognition device and method which either counts or measures geometric characteristics (such as a number or length of a circumference) of objects as the two-dimensional patterns at a high speed or discriminates two-dimensional patterns at a high speed by learning.
Further, according to this invention, the method is largely used as the general purpose image measurement and recognition device in which adaptive learning function and high speed of real time are requested.
2. Description of the Prior Art
In the prior art, an image measurement device is realized by sequentially and serially combining image processing techniques which are judged necessary in order to achieve particular tasks as shown in FIG. 1 (Sequential and Procedural Method). For example, in order to count the number of two types of particles a binary image including a large number of particles of two different radii, all the particles (black circles) on a screen (white background) are first detected, and discriminated by attaching labels (numbers) to the respective particles. Next, their diameters, areas and so on are respectively measured, the type of the groups to each particle belongs is decided, and the decision numbers are counted to finally obtain the respective numbers of particles of two different groups.
Since the above prior art devices are realized by combining various and complicated image processing techniques sequentially, the processing takes a long time for the calculation, and the entire system inevitably becomes large and complicated, posing a problem in high speed processing. The most critical problem inherent to these devices is that the duration of time necessary for the processing increases in proportion to the degree of complexity (e.g. the number of the particles in the above example) of the objective images. Another problem exists in that since these series of processings are those each prepared to achieve a specific and predetermined purpose, the device is dedicated solely to the predetermined purposes, and techniques should be modified for different uses. Moreover, these devices can be applied only to problems which are clearly known what is to be measured by which technique in what procedure.
Besides the above mentioned serial measurement method, there is proposed a parallel and adaptive method such as the models of "perceptron" or "neural networks" in pattern recognition. FIG. 2 shows the structure of such the neural networks which is modelled after the information processing of the brain. In the figure, layers (input layer, intermediate layer and output layer) having a large number of elements modelled after characteristics of neurons are connected in multilayers, and their connection coefficients are set as variable weights (parameters). In order to output desirable results (measured results) for the inputs, a large number of data for the learning operation are sequentially inputted, and the above connection coefficients are sequentially modified every time an error is made in output.
However, the above-mentioned measuring method is slow in covergence speed of the learning operation, although it is fast in measuring processing because of the parallel processing. Further, local optimal solutions sometimes make obtaining the global optimal result difficult. Although the measuring method is adaptive and universal, the practical application inevitably takes a trial-and-error manner because it is not known that number of elements should be combined in what way to a particular problem or what should be inputted. The elements used in such the neural networks are restricted to use the input and output signals in the two values of "0" and "1" or the values therebetween on the model of neuron cells. Therefore, the weighted sum 10 of a large number of inputs is non-linearly transformed 11 before becoming one output as shown in FIG. 3. Although the expression of information in this type of measuring method is significant as a model of a neurological information processing, it is not quite important in practice and is rather limitative and inefficient. Therefore, the measuring method has some problems and limitations as a practical image measuring device.
U.S. Pat. No. 4,288,779, corresponding to Japanese Patent Publication (KOKOKU) No. 47064/1983, discloses a system which can discriminate two-dimensional patterns at a high speed and measure geometrical features of the patterns at a high speed. However, since the measuring method must have other machines do arithmetic operations necessary for the character recognition to have the results in advance, its usage is limited. It is limited in usages for reading out the characters because it solely aims at providing the features which do not need segmentation of a character, and it is not quite adaptive to the changes in the size and forms of the objective patterns. Therefore, the measuring method is not quite adaptive nor universal when a user wishes to apply it to a particular need at a particular shop. Since it is generally not easy to predict environmental conditions (disturbance, for example mistiness and image quality) and so on of the device in advance, it is impossible to prepare a method which is most adaptive and optimal to particular conditions.